﻿@model Amazon.Checkout.ViewModels.SiteSettingsViewModel

@using Amazon.Checkout.Helpers;
@using System.Web.Mvc;
@using Orchard.Utility.Extensions;

<style type="text/css">
    ul.amazon-default-settings li { float:left; display:block; width:280px; }
</style>

@using (Html.BeginForm("SaveSettings", "Admin", new { area = "Amazon.Checkout" }, FormMethod.Post, new { @class = "amazon-settings" }))
{
<fieldset>
    <legend>@T("Checkout By Amazon Settings")</legend>
    
    <h3>@T("Account Settings")</h3>
    <div>
        @Html.LabelFor(m => m.MerchantId, T("Merchant Identifier"))
        @Html.TextBox("MerchantId", Model.MerchantId, new { @class = "textMedium" })
        <span class="hint">
            @T("You can get your Merchant ID at ")
            <a target="_blank" href="https://sellercentral.amazon.com/gp/on-board/workflow/Registration/login.html?passthrough/&passthrough/account=soa&passthrough/superSource=OAR&passthrough/marketplaceID=ATVPDKIKX0DER&passthrough/&passthrough%2Fld=AZSYHSOAAS"
                title="Amazon Seller Central">Amazon Seller Central</a>
            @T("website.")
        </span>
        @Html.LabelFor(m => m.AwsAccessKeyId, T("Amazon Access Key ID"))
        @Html.TextBox("AwsAccessKeyId", Model.AwsAccessKeyId, new { @class = "textMedium" })
        @Html.LabelFor(m => m.SecretKeyId, T("Amazon Secret Access Key"))
        @Html.TextBox("SecretKeyId", Model.SecretKeyId, new { @class = "textMedium" })
        <span class="hint">
            @T("You can get your Access Key ID & Secret Access Key at ")
            <a target="_blank" href="http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key"
                title="Amazon Web Services">Amazon Web Services</a>
            @T("website.")
        </span>
        @Html.LabelFor(m => m.AssociateTag, T("Associate Tag"))
        @Html.TextBox("AssociateTag", Model.AssociateTag, new { @class = "textMedium" })
        <span class="hint">
            @T("You can get your Associate Tag at ")
            <a target="_blank" href="https://affiliate-program.amazon.com/" title="Amazon Associates">
                Amazon Associates</a>
            @T("website.")
        </span>
    </div>

    <h3>@T("Shopping Cart Settings")</h3>
    <div>
        @Html.LabelFor(m => m.PromotionId, T("Promotion Code"))
        @Html.DropDownList("PromotionId", new SelectList(Model.Promotions.ToList().ToDictionary(key => key.Id, value => value.PromotionCode), "Key", "Value", Model.PromotionId))
    </div>

    <h3>@T("Default Settings")</h3>
    <ul class="amazon-default-settings">
        <li>
            @Html.LabelFor(m => m.CurrencyCode, T("Currency Code"))
            @Html.DropDownList("CurrencyCode", new SelectList(AmazonCheckout.AvailableCurrencyCodes.ToList().ToDictionary(key => key, value => value), "Key", "Value", Model.CurrencyCode ?? "USD"))
        </li>
        <li>
            @Html.LabelFor(m => m.LengthUnitOfMeasure, T("Length Unit of Measure"))
            @Html.DropDownList("LengthUnitOfMeasure", new SelectList(AmazonCheckout.AvailableLengthUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.LengthUnitOfMeasure ?? "IN"))
        </li>
        <li>
            @Html.LabelFor(m => m.VolumeUnitOfMeasure, T("Volume Unit of Measure"))
            @Html.DropDownList("VolumeUnitOfMeasure", new SelectList(AmazonCheckout.AvailableVolumeUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.VolumeUnitOfMeasure ?? "cubic-cm"))
        </li>
        <li>
            @Html.LabelFor(m => m.WeightUnitOfMeasure, T("Weight Unit of Measure"))
            @Html.DropDownList("WeightUnitOfMeasure", new SelectList(AmazonCheckout.AvailableWeightUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.WeightUnitOfMeasure ?? "LB"))
        </li>
        <li>
            @Html.LabelFor(m => m.JewelryWeightUnitOfMeasure, T("Jewelry Weight Unit of Measure"))
            @Html.DropDownList("JewelryWeightUnitOfMeasure", new SelectList(AmazonCheckout.AvailableJewelryWeightUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.JewelryWeightUnitOfMeasure ?? "LB"))
        </li>
        <li>
            @Html.LabelFor(m => m.DegreeUnitOfMeasure, T("Degree Unit of Measure"))
            @Html.DropDownList("DegreeUnitOfMeasure", new SelectList(AmazonCheckout.AvailableDegreeUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.DegreeUnitOfMeasure ?? "degrees"))
        </li>
        <li>
            @Html.LabelFor(m => m.MemorySizeUnitOfMeasure, T("Memory Size Unit of Measure"))
            @Html.DropDownList("MemorySizeUnitOfMeasure", new SelectList(AmazonCheckout.AvailableMemorySizeUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.MemorySizeUnitOfMeasure ?? "GB"))
        </li>
        <li>
            @Html.LabelFor(m => m.FrequencyUnitOfMeasure, T("Frequency Unit of Measure"))
            @Html.DropDownList("FrequencyUnitOfMeasure", new SelectList(AmazonCheckout.AvailableFrequencyUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.FrequencyUnitOfMeasure ?? "MHz"))
        </li>
        <li>
            @Html.LabelFor(m => m.AmperageUnitOfMeasure, T("Amperage Unit of Measure"))
            @Html.DropDownList("AmperageUnitOfMeasure", new SelectList(AmazonCheckout.AvailableAmperageUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.AmperageUnitOfMeasure ?? "amps"))
        </li>
        <li>
            @Html.LabelFor(m => m.TimeUnitOfMeasure, T("Time Unit of Measure"))
            @Html.DropDownList("TimeUnitOfMeasure", new SelectList(AmazonCheckout.AvailableTimeUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.TimeUnitOfMeasure ?? "sec"))
        </li>
        <li>
            @Html.LabelFor(m => m.DateUnitOfMeasure, T("Date Unit of Measure"))
            @Html.DropDownList("DateUnitOfMeasure", new SelectList(AmazonCheckout.AvailableDateUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.DateUnitOfMeasure ?? "days"))
        </li>
        <li>
            @Html.LabelFor(m => m.AssemblyTimeUnitOfMeasure, T("Assembly Time Unit of Measure"))
            @Html.DropDownList("AssemblyTimeUnitOfMeasure", new SelectList(AmazonCheckout.AvailableAssemblyTimeUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.AssemblyTimeUnitOfMeasure ?? "minutes"))
        </li>
        <li>
            @Html.LabelFor(m => m.AgeRecommendedUnitOfMeasure, T("Age Recommended Unit of Measure"))
            @Html.DropDownList("AgeRecommendedUnitOfMeasure", new SelectList(AmazonCheckout.AvailableAgeRecommendedUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.AgeRecommendedUnitOfMeasure ?? "months"))
        </li>
        <li>
            @Html.LabelFor(m => m.BatteryPowerUnitOfMeasure, T("Battery Power Unit of Measure"))
            @Html.DropDownList("BatteryPowerUnitOfMeasure", new SelectList(AmazonCheckout.AvailableBatteryPowerUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.BatteryPowerUnitOfMeasure ?? "mAh"))
        </li>
        <li>
            @Html.LabelFor(m => m.VoltageUnitOfMeasure, T("Voltage Unit of Measure"))
            @Html.DropDownList("VoltageUnitOfMeasure", new SelectList(AmazonCheckout.AvailableVoltageUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.VoltageUnitOfMeasure ?? "volts"))
        </li>
        <li>
            @Html.LabelFor(m => m.WattageUnitOfMeasure, T("Wattage Unit of Measure"))
            @Html.DropDownList("WattageUnitOfMeasure", new SelectList(AmazonCheckout.AvailableWattageUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.WattageUnitOfMeasure ?? "watts"))
        </li>
        <li>
            @Html.LabelFor(m => m.TemperatureRatingUnitOfMeasure, T("Temperature Rating Unit of Measure"))
            @Html.DropDownList("TemperatureRatingUnitOfMeasure", new SelectList(AmazonCheckout.AvailableTemperatureRatingUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.TemperatureRatingUnitOfMeasure ?? "degrees-celsius"))
        </li>
        <li>
            @Html.LabelFor(m => m.ClothingSizeUnitOfMeasure, T("Clothing Size Unit of Measure"))
            @Html.DropDownList("ClothingSizeUnitOfMeasure", new SelectList(AmazonCheckout.AvailableClothingSizeUnitOfMeasures.ToDictionary(key => key, value => value), "Key", "Value", Model.ClothingSizeUnitOfMeasure ?? "IN"))
        </li>
    </ul>
</fieldset>

  @Html.Hidden("ReturnUrl", Context.Request.ToUrlString()) 
  @Html.AntiForgeryTokenOrchard() 

  <button class="primaryAction" type="submit">@T("Save")</button>
}